<%@ Control Language="C#" ClassName="States" Inherits="Dimok.Web.UI.TableControl" %>
<%@ Register Namespace="Dimok.Web.UI"  Assembly="Dimok.Web.UI" TagPrefix="OR"  %>

<script runat="server">
</script>

<asp:UpdatePanel ID="pnlRebateOffers" UpdateMode="Always" runat="server">
	<ContentTemplate>
		<OR:GridViewEx ID="grv" runat="server" AutoGenerateColumns="False" DataSourceID="ds"
			ShowFooter="True" AllowSorting="True" BackColor="Window" CellPadding="0" EnableTheming="True"
			Font-Names="verdana" EnableViewState="False" DataKeyNames="ID"
			ViewNameUpdate="t_State" ViewNameInsert="t_State" DebugMode="false"
			>
			<Columns>

				<!-- #include virtual = "~/Controls/_FieldTemplates/ID.txt" -->
				<!-- #include virtual = "~/Controls/_FieldTemplates/Name.txt" -->
				<asp:TemplateField HeaderText="Nick" SortExpression="Nick">
					<ItemTemplate><asp:Label Text='<%#Eval("Nick") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate><asp:TextBox ID="txtNick" Text='<%# Bind("Nick") %>' runat="server" /></EditItemTemplate>
					<FooterTemplate><asp:TextBox ID="Nick" Text='<%# Bind("Nick") %>' cssclass="Streach" runat="server" /></FooterTemplate>
				</asp:TemplateField>
				<asp:TemplateField HeaderText="Pos" SortExpression="Pos">
					<ItemTemplate><asp:Label Text='<%#Eval("Pos") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate><asp:TextBox ID="txtPos" Text='<%# Bind("Pos") %>' runat="server" /></EditItemTemplate>
					<FooterTemplate><asp:TextBox ID="Pos" Text='<%# Bind("Pos") %>' cssclass="Streach" runat="server" /></FooterTemplate>
				</asp:TemplateField>

				<asp:TemplateField HeaderText="Parent" SortExpression="ParentName">
					<ItemTemplate><asp:Label Text='<%#Eval("ParentName") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate>
						<asp:DropDownList ID="selParentID" DataSourceID="dsStateParents" DataTextField="Name" DataValueField="ID" runat="server"
								 SelectedValue='<%# Bind("ParentID") %>'></asp:DropDownList>
					</EditItemTemplate>
					<FooterTemplate>
						<asp:DropDownList ID="ParentID" DataSourceID="dsStateParents" DataTextField="Name" DataValueField="ID" runat="server"></asp:DropDownList>
					</FooterTemplate>
				</asp:TemplateField>

				<asp:TemplateField HeaderText="TableName" SortExpression="TableName">
					<ItemTemplate><asp:Label Text='<%#Eval("TableName") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate><asp:TextBox id="txtTableName" Text='<%#Bind("TableName") %>' runat="server" /></EditItemTemplate>
					<FooterTemplate><asp:TextBox id="TableName" runat="server" /></FooterTemplate>
				</asp:TemplateField>

				<asp:TemplateField HeaderText="Is Menu" SortExpression="IsMenu">
					<ItemTemplate><asp:Label Text='<%#Eval("IsMenu") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate><asp:CheckBox id="chkIsMenu" Checked='<%#Bind("IsMenu") %>' runat="server" /></EditItemTemplate>
					<FooterTemplate><asp:CheckBox id="IsMenu" runat="server" /></FooterTemplate>
				</asp:TemplateField>

				<asp:TemplateField HeaderText="OnClick" SortExpression="OnClick">
					<ItemTemplate><asp:Label Text='<%#Eval("OnClick") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate><asp:TextBox id="txtOnClick" Text='<%#Bind("OnClick") %>' runat="server" /></EditItemTemplate>
					<FooterTemplate><asp:TextBox id="OnClick" runat="server" /></FooterTemplate>
				</asp:TemplateField>

				<asp:TemplateField HeaderText="Target" SortExpression="Target">
					<ItemTemplate><asp:Label Text='<%#Eval("Target") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate><asp:TextBox id="txtTarget" Text='<%#Bind("Target") %>' runat="server" /></EditItemTemplate>
					<FooterTemplate><asp:TextBox id="Target" runat="server" /></FooterTemplate>
				</asp:TemplateField>

				<asp:TemplateField HeaderText="Style" SortExpression="Style">
					<ItemTemplate><asp:Label Text='<%#Eval("Style") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate><asp:TextBox id="txtStyle" Text='<%#Bind("Style") %>' runat="server" /></EditItemTemplate>
					<FooterTemplate><asp:TextBox id="Style" runat="server" /></FooterTemplate>
				</asp:TemplateField>

				<asp:TemplateField HeaderText="Icon" SortExpression="Icon">
					<ItemTemplate><asp:Label Text='<%#Eval("Icon") %>' runat="server" /></ItemTemplate>
					<EditItemTemplate><asp:TextBox id="txtIcon" Text='<%#Bind("Icon") %>' runat="server" /></EditItemTemplate>
					<FooterTemplate><asp:TextBox id="Icon" runat="server" /></FooterTemplate>
				</asp:TemplateField>

				<!-- #include virtual = "~/Controls/_FieldTemplates/Description.asp" -->

			</Columns>
		</OR:GridViewEx>
	</ContentTemplate>
</asp:UpdatePanel>

<DS:StatesDataSource ID="ds" runat="server" />
<DS:StateParentsDataSource ID="dsStateParents" runat="server" />
<DS:StateTablesDataSource ID="dsStateTables" runat="server"></DS:StateTablesDataSource>
